# -*- coding: utf-8 -*-
# @Time : 2019/1/11 9:27
# @Author : Administrator
# @File : employment.py
# @Project : python
# @title : 接口测试 -- 企业客户
import unittest,ddt
from woniuboss_interface.util.read_data import Read_Excel
from woniuboss_interface.common.login_decode import Login

data_li = Read_Excel()
ses,host,excel_path = Login()
@ddt.ddt
class enterprise(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        print("企业客户测试开始")

    @classmethod
    def tearDownClass(cls):
        print("企业客户测试完成")

    @ddt.data(*data_li.excel(excel_path,3))
    def test_add(self,data):     #新增企业
        response = ses.get(host+"/enterprise/addEnterp?ent.ent_name="+data["ent_name"]+"&ent.ent_category="+data["ent_category"]+"&ent.ent_addr="+data["ent_addr"]+"&ent.ent_header="+data["ent_header"]+"&ent.tel="+data["tel"]+"&ent.email="+data["email"]+"&ent.qq="+str(int(data["qq"])))
        print(response.text)


if __name__ == '__main__':
    unittest.main()

